package ie.ul.breakthrough;

/** Contains a breakthrough move: row1, col1, row2, col2
	moving a piece from source coordinate row1,col1 to
	destination coordinate row2,col2
	(0,0 is the top left of the board) */
public class BreakthroughMove
{
	protected int row1;
	protected int col1;
	protected int row2;
	protected int col2;

	protected boolean wonGame;
	protected boolean lostGame;

	/** BreakthroughMove constructor */
	public BreakthroughMove(int r1, int c1, int r2, int c2)
	{
		row1=r1;
		col1=c1;
		row2=r2;
		col2=c2;
		wonGame = false;
		lostGame = false;
	}

	/** Source position row getter */
	public int getRow1()
	{
		return row1;
	}

	/** Source position column getter */
	public int getCol1()
	{
		return col1;
	}

	/** Destination position row getter */
	public int getRow2()
	{
		return row2;
	}

	/** Destination position column getter */
	public int getCol2()
	{
		return col2;
	}

	/** Sets this move to indicate a won game */
	public void wonGame()
	{
		wonGame = true;
	}

	/** Sets this move to indicate a lost game */
	public void lostGame()
	{
		lostGame = true;
	}



	/** Checks if this is a "won game" move */
	public boolean isWonGame()
	{
		return wonGame;
	}

	/** Checks if this is a "lost game" move */
	public boolean isLostGame()
	{
		return lostGame;
	}



	/** Gives a textual representation of this move */
	public String toString()
	{
		return "(" + row1 + ", " + col1 + ", " + row2 + ", " + col2 + ")";
	}


}